import request from "@/utils/request";
import requesta from "@/utils/requesta";

// 查询产品入库录列表
export function listProductrecpt(query) {
  return request({
    url: "/mes/wm/productrecpt/list",
    method: "get",
    params: query,
  });
}
// 产品列表
export function listProductproduceline(query) {
  return request({
    url: "/mes/wm/productrecptline/list",
    method: "get",
    params: query,
  });
}

// 查询产品入库录详细
export function getProductrecpt(recptId) {
  return request({
    url: "/mes/wm/productrecpt/" + recptId,
    method: "get",
  });
}

// 新增产品入库录
export function addProductrecpt(data) {
  return request({
    url: "/mes/wm/productrecpt",
    method: "post",
    data: data,
  });
}

// 修改产品入库录
export function updateProductrecpt(data) {
  return request({
    url: "/mes/wm/productrecpt",
    method: "put",
    data: data,
  });
}

// 删除产品入库录
export function delProductrecpt(recptId) {
  return request({
    url: "/mes/wm/productrecpt/" + recptId,
    method: "delete",
  });
}

//执行入库
export function execute(recptId) {
  return request({
    url: "/mes/wm/productrecpt/" + recptId,
    method: "put",
  });
}

export function listProductsalseLine(query) {
  return request({
    url: "/mes/wm/wmProductRecptItem/list",
    method: "get",
    params: query,
  });
}

export function printProduct(id) {
  return request({
    url: "/mes/wm/productrecptline/listById/" + id,
    method: "get",
  });
}

// 打印入库批次号
export function printBatchCode(data) {
  return requesta({
    url: "/hici/print/wmproductRecpt", //'/mes/pro/workorderSn/print',
    method: "post",
    data: data,
  });
}

// 2024-12-13 产品入库单撤回
export function revokeProduct(query) {
  return request({
    url: "/mes/wm/productrecpt/revokeProduct",
    method: "get",
    params: query,
  });
}

export function saveToErp(recptId) {
  return request({
    url:
      "/mes/k3cloud/api/wmProductRecpt/WmProductRecptToErp/saveToErp/" +
      recptId,
    method: "get",
  });
}
